package zmee.pur.formplugin;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.basedata.BaseDataServiceHelper;

import java.util.EventObject;


/**
 * @className: SupplierregFormPlugin
 * @description: 填写注册资料自动带注册审核单位
 * @author: zilongluo
 * @date: 2022/12/4
 * @Version: 1.0
 **/
public class SupplierregFormPlugin extends AbstractFormPlugin {
    @Override
    public void afterBindData(EventObject e) {
        //携带注册审核单位自出资料，并设置锁定性
        DynamicObject org = BusinessDataServiceHelper.loadSingle("bos_org", "id", new QFilter[]{new QFilter("number", QCP.equals, "26501")});
        this.getModel().setValue("org",org.get("id"));
        this.getView().setEnable(false,"org");


    }
}
